package com.self.lock.distribute.redis;

import com.self.lock.distribute.DistributeLock;
import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

public class RedisDistributeLock implements DistributeLock {

    @Override
    public boolean lock(String lockKey, long timeout) {

        Config config = new Config();
        config.useMasterSlaveServers().setMasterAddress("").addSlaveAddress("");
        RedissonClient redissonClient = Redisson.create();

        RLock lock = redissonClient.getFairLock(lockKey);

        return false;
    }
}
